/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ChessTable.java
 *
 * Created on 11-09-2014, 22:53:04
 */
package demochess;

import javax.swing.JButton;

/**
 *
 * @author Nhattruong
 */
public class ChessTable extends javax.swing.JPanel {

    JButton[][] tableCell = new JButton[8][8];

    public JButton[][] getTableCell() {
        return tableCell;
    }

    /** Creates new form ChessTable */
    public ChessTable() {
        initComponents();
        for (int i = 0; i < 8; i++) {
            for (int j = 0; j < 8; j++) {
                tableCell[i][j] = new JButton();
                tableCell[i][j].setName(i + "-" + j);
                add(tableCell[i][j]);
            }
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setLayout(new java.awt.GridLayout(8, 8));
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
